package com.tang.algorithm.listnode;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/6/14 20:28
 */
public class Mst0202 {
    public int kthToLast(ListNode head, int k) {
        ListNode last = head;
        for (int i = 0; i <k ; i++) {
            last=last.next;
        }
        while (last!=null){
            head=head.next;
            last=last.next;
        }
        return head.val;
    }
}
